home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_31 / config.asm < prev    next >
Assembly Source File  |  1995-01-01  |  3KB  |  122 lines

  1. proc        ReadGConfig
  2.         push    ds
  3.         mov    ax,MyData
  4.         mov    ds,ax
  5.         mov    si,offset GConfigFile
  6.         call    PutName
  7.         mov    dx,offset GDirectory
  8.                 mov     cx,seg GDirectory
  9.         mov    ds,cx
  10.         mov    ax,3D00h
  11.         int    21h
  12.         jb    @@NoFind
  13.         mov    bx,ax
  14.         mov    cx,11
  15.         mov    ax,cs
  16.         mov    ds,ax
  17.         mov    dx,offset GUSPort
  18.         mov    ah,3Fh
  19.                 int     21h
  20.         mov    ah,3Eh
  21.                 int     21h
  22.         pop    ds
  23.         ret
  24. @@NoFind:    mov    dx,offset NoGCFound
  25.         call    Error
  26.         pop    ds
  27.         ret
  28. endp        ReadGConfig
  29.  
  30. ; si - offset Config file name
  31. proc            ReadConfig
  32.         push    ds
  33.         mov    ax,MyData
  34.         mov    ds,ax
  35.         call    PutName
  36.         mov    dx,offset GDirectory
  37.                 mov     cx,seg GDirectory
  38.         mov    ds,cx
  39.         mov    ax,3D00h
  40.         int    21h
  41.         jb    @@SetInfo
  42.         mov    bx,ax
  43.         mov    cx,11
  44.         mov    ax,cs
  45.         mov    ds,ax
  46.         mov    dx,offset Mode
  47.         mov    ah,3Fh
  48.                 int     21h
  49.         mov    ah,3Eh
  50.                 int     21h
  51. @@SetInfo:    call    GetInfo
  52.         mov    al,[cs:MaxVol]
  53.                 mov     [cs:offset MMus+(offset (SMus).MaxVolume)],al
  54.         mov    al,[cs:PlayStat]
  55.         mov    [cs:offset MMus+(offset (SMus).PlayStatus)],al
  56.         mov    cx,00000011b
  57.         call    SetInfo
  58.                 cli
  59.         les    di,[cs:offset MMus+(offset (SMus).ChannelLoc)]
  60.         mov    bx,0
  61. @@CopyLoop:    mov    al,[cs:bx+PanPos]
  62.         mov    [es:di+MS.sc_PanPosition],al
  63.         mov    al,[cs:bx+ChanVol]
  64.         mov    [es:di+MS.MasterVolume],al
  65.         add    di,size MS
  66.         inc    bx
  67.         cmp    bx,4
  68.         jnz    @@CopyLoop
  69.         sti
  70.         call    GetInfo
  71.         call    Ed_Percent
  72.         call    Ed_Pan
  73.                 call    Ed_PlayStatus
  74. @@NoFind:       pop     ds
  75.         ret
  76. endp            ReadConfig
  77.  
  78. ; si - Config Name
  79. proc            WriteConfig
  80.         push    ds
  81.         mov    ax,MyData
  82.         mov    ds,ax
  83.         call    PutName
  84.         mov    dx,offset GDirectory
  85.                 mov     cx,seg GDirectory
  86.         mov    ds,cx
  87.         mov    cx,0
  88.         mov    ah,3Ch
  89.         int    21h
  90.         jb    @@NoFind
  91.         push    ax
  92.         call    GetInfo
  93.                 cli
  94.                 les     di,[cs:offset MMus+(offset (SMus).ChannelLoc)]
  95.                 mov     bx,0
  96. @@CopyLoop:    mov    al,[es:di+MS.sc_PanPosition]
  97.                 mov     [cs:bx+PanPos],al
  98.         mov    al,[es:di+MS.MasterVolume]
  99.                 mov     [cs:bx+ChanVol],al
  100.                 add     di,size MS
  101.                 inc     bx
  102.                 cmp     bx,4
  103.                 jnz     @@CopyLoop
  104.         mov    al,[cs:offset MMus+(offset (SMus).MaxVolume)]
  105.         mov    [cs:MaxVol],al
  106.         mov    al,[cs:offset MMus+(offset (SMus).PlayStatus)]
  107.         mov    [cs:PlayStat],al
  108.                 sti
  109.                 pop     bx
  110.         mov    cx,11
  111.         mov    ax,cs
  112.         mov    ds,ax
  113.         mov    dx,offset Mode
  114.         mov    ah,40h
  115.                 int     21h
  116.         mov    ah,3Eh
  117.                 int     21h
  118. @@NoFind:       pop     ds
  119.         ret
  120. endp        WriteConfig
  121.  
  122.